<?php

class OrderDailyMissionRewardAction extends SzAbstractAction
{
    protected $paramTypes = array(
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_INT,
    );

    /**
     * 领取完成订单数量任务奖励
     *
     * @param int $userId
     * @param int $purposeId
     * @param int $reqTime
     * @return SzResponse
     */
    public function execute($userId, $purposeId, $reqTime)
    {
        GameService::get()->validateMultiRequestTimeDelta($userId, $reqTime);
        if (!GameService::get()->verifySysUnlock($userId, GameConst::FUNC_NORMAL_ORDER)) {
            return $this->buildResponse(false);
        }
        return $this->buildResponse([
                'rewards' => OrderService::get()->getOrderDailyMissionReward($userId, $purposeId)
            ]
        );
    }
}